$('#add').click(function () {
	 var formData = new FormData(); 
		formData.set("diseaseName",$("#disease_name").val());
		formData.set("content",$("#content").val());
		formData.set("category",$("#category").val());
		formData.set("distribution",$("#distribution").val());
	
		formData.set("imgPath", document.getElementById("img_path").files[0]);
	/*	formData.set("imgPath",$("#img_path").val());*/
	    $.ajax({
	    	  url: "/citrusmonitor/disease.do?method=add",
	        type: "post",
	        data:formData, 
	        processData:false, 
	        contentType:false,
	        dataType: "json",
	        success: function (msg) {
	            if (msg.status==1) {
	                alert("添加成功");
	                window.location.href="show.html";
	            } else {
	                alert("添加失败" );
	            }
	        },
	        error:function(){
	            alert("资源加载失败！！！");
	        }
})
	
    /*$.ajax({
        url: "/citrusmonitor/disease.do?method=add",
        type: "post",
        contentType: "application/x-www-form-urlencoded;charset=utf-8",
        data: {
            "diseaseName": $("#disease_name").val(),
            "content": $("#content").val(),
            "category": $("#category").val(),
            "distribution": $("#distribution").val(),
            "imgPath": $("#img_path").val()
        },
        
        dataType: "json",
        success: function (msg) {
            if (msg.status==1) {
                alert("添加成功");
            } else {
                alert("添加失败" );
            }
        },
        error:function(){
            alert("资源加载失败！！！");
        }
    })*/
})